package day32;
import java.util.*;
public class A1 {


    /**
     * 素数回文 -- 只完成50%
     * @param args
     */
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextInt()) { // 注意 while 处理多个 case
            int t = in.nextInt();
            StringBuilder sb = new StringBuilder();
            String s = String.valueOf(t);
            sb.append(s);
            StringBuilder ts = new StringBuilder(s);
            ts.deleteCharAt(ts.length()-1).reverse();
            sb.append(ts);
            long ret = Integer.parseInt(sb.toString());
            //判断是否为素数
            boolean bool=false;
            for(int i=2;i<ret;i++) {
                if(ret%i==0) {
                    bool=true;
                    break;
                }
            }
            if(bool) System.out.println("noprime");
            else System.out.println("prime");
        }
    }
}
